/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package rg1generaldemo;

import java.util.Random;

/**
 *
 * @author apple
 */
public class VerifyCode {
    
    private static String str="0123456789abcdefghijklmnopqrstuvwxyz";
    public static String getCode(int size)
    {
        Random rd=new Random();
        StringBuilder code=new StringBuilder();
        for(int i=0;i<size;i++)
        {
            char temp=str.charAt(rd.nextInt(36));
            code.append(temp);
        }
        return code.toString();
    }
    
}
